<?php 

/* Set up scoring funtions */

add_action( 'show_user_profile', 'wpwt_custom_profile' );
add_action( 'edit_user_profile', 'wpwt_custom_profile' );

function wpwt_custom_profile( $user ) { ?>

	<table class="form-table">

		<tr>
			<th><label for="score"><?php _e("Score"); ?></label></th>

			<td>
				<input type="text" name="score" id="score" class="text" disabled="disabled" value="<?php echo esc_attr( get_user_meta( $user->ID, 'score', true ) ); ?>" /><br />
				<span class="description"><?php _e("Your current score"); ?></span>
			</td>
		</tr>

	</table>
	
	<h3><?php _e( "WPWT Options" ); ?></h3>
	
	<table class="form-table">
	
	  <tr>
			<th><label for="uppercase"><?php _e("Uppercase"); ?></label></th>

			<td>
				<input type="checkbox" name="uppercase" id="uppercase" class="checkbox"<?php if ( get_user_meta($user->ID, 'uppercase', true ) == '1' ) { echo ' checked="checked"'; } ?> /><br />
				<span class="description"><?php _e("Show the whole site in uppercase."); ?></span>
			</td>
		</tr>
		
	</table>
	
	<script type="text/javascript">
		
		jQuery(document).ready(function($) {
		  
		  $( '#your-profile h3:eq(0), .form-table:eq(0), #your-profile h3:eq(2), .form-table:eq(2)' ).hide();
		  $( 'label[for="description"]' ).parentsUntil( 'tbody', 'tr' ).hide();
		  
		  $( '#your-profile h3:eq(1)' ).text( '<?php _e( "Personal Options" ); ?>' );
		  $( 'label[for="email"]' ).parentsUntil( 'tbody', 'tr' )
		    .appendTo( '.form-table:eq(1) tbody' );
		  
		});
		
	</script>
	
<?php } ?>